package com.neusoft.bizcore.license.bean;

import java.io.Serializable;
import java.util.Date;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;

import org.springframework.format.annotation.DateTimeFormat;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class LicenseCreateBean implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 证书subject
     */
    @NotEmpty(message = "主题不能为空")
    private String subject;

    /**
     * 证书生效时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date issuedTime = new Date();

    /**
     * 有效期
     */
    @Min(value = 1, message = "有效期不能为空")
    private int days = 1;

    /**
     * 附加信息
     */
    @NotEmpty(message = "附加信息不能为空")
    private String info = "";

    /**
     * 秘钥库位置
     */
    @NotEmpty(message = "秘钥库位置不能为空")
    private String storePath;

    /**
     * 秘钥库密码
     */
    @NotEmpty(message = "秘钥库密码不能为空")
    private String storePass;

    /**
     * 秘钥别名
     */
    @NotEmpty(message = "秘钥别名不能为空")
    private String alias;

    /**
     * 密钥密码
     */
    @NotEmpty(message = "密钥密码不能为空")
    private String keyPass;

    /**
     * 用户类型
     */
    private String consumerType = "User";

    /**
     * 用户数量
     */
    private Integer consumerAmount = 1;

}
